//
//  EyeTestResult.swift
//  Center
//
//  Created by Flutter on 2021/8/3.
//

import Foundation
import RealmSwift

public class EyeTestInfo: Object {
    
    @Persisted(primaryKey: true) public var _id: ObjectId
    @Persisted public var leftVisionIndex: Int?
    @Persisted public var rightVisionIndex: Int?
    @Persisted public var leftDetail: List<EyeTestDetailInfo>
    @Persisted public var rightDetail: List<EyeTestDetailInfo>
    @Persisted public var createdAt: Date = Date()
    
    @Persisted(originProperty: "eyeTestHistory") var assignee: LinkingObjects<Person>
}


public class EyeTestDetailInfo: EmbeddedObject {
    @Persisted public var right: Int = 0
    @Persisted public var wrong: Int = 0
    @Persisted public var visionIndex: Int = 0
}
